<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>4_复选框控制显示隐藏</title>
    <script src="./lib/angularjs.js"></script>
</head>

<body ng-app="myApp" ng-controller="myCtrl">
    <label for="game"><input id="game" type="checkbox" ng-model="data.game" ng-true-value="1"
            ng-false-value="0" />游戏</label>
    <label for="video"><input id="video" type="checkbox" ng-model="data.video" ng-true-value="1"
            ng-false-value="0" />电影</label>
    <div>{{data}}</div>
    <div ng-show="data.game === 1">
        <h3>游戏</h3>
        <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
    <div ng-show="data.video === 1">
        <h3>电影</h3>
        <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
</body>

<script>
    const myApp = angular.module("myApp", [])
    myApp.controller("myCtrl", ["$scope", function ($scope) {
        $scope.data = {
            game: 0,
            video: 0
        }
    }])
</script>

</html>